<!DOCTYPE html><head>
    <meta charset="utf-8">
    <title>ECharts</title>
</head>

<style>
     *{ padding:0px; margin:0px;}
     html,body{ width:100%; height:100%; overflow:hidden;}
</style>
<body>
    <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
    <div id="main" style="height:370px"></div>
    <!-- ECharts单文件引入 -->
    <script src="http://echarts.baidu.com/build/dist/echarts.js"></script>
    <script type="text/javascript">
        // 路径配置
        require.config({
            paths: {
                echarts: 'http://echarts.baidu.com/build/dist'
            }
        });
        
        // 使用
        require(
            [
                'echarts',
                'echarts/chart/bar' // 使用柱状图就加载bar模块，按需加载
            ],
            function (ec) {
                // 基于准备好的dom，初始化echarts图表
                var myChart = ec.init(document.getElementById('main')); 
                
                option = {
    title : {
        //text: '江村家禽批发市场',
       // subtext: '纯属虚构'
    },
    tooltip : {
        trigger: 'axis'
    },
    legend: {
        data:['新兴三黄鸡','黎村走地鸡']
    },
    toolbox: {
        show : true,
        feature : {
            mark : {show: true},
            dataView : {show: true, readOnly: false},
            magicType : {show: true, type: ['line', 'bar']},
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    calculable : true,
    xAxis : [
        {
            type : 'category',
            data : ['7/12','7/13','7/13','7/14','7/15','7/16','7/17','7/18']
        }
    ],
    yAxis : [
        {
            type : 'value'
        }
    ],
    series : [
        {
            name:'新兴三黄鸡',
            type:'bar',
            data:[10.0, 9.8, 9.9, 10.5, 9.7, 8.9, 9.5, 10.2],
            markPoint : {
                data : [
                    {type : 'max', name: '最大值'},
                    {type : 'min', name: '最小值'}
                ]
            },
            markLine : {
                data : [
                    {type : 'average', name: '平均值'}
                ]
            }
        },
        {
            name:'黎村走地鸡',
            type:'bar',
            data:[12.9, 13.2, 12.1, 12.0,13.1, 12.8, 12.9,13.0,],
            markPoint : {
                data : [
                    //{name : '日最高', value : 182.2, xAxis: 7, yAxis: 183, symbolSize:18},
                   // {name : '日最低', value : 8.9, xAxis: 11, yAxis: 3}
                ]
            },
            markLine : {
                data : [
                    {type : 'average', name : '平均值'}
                ]
            }
        }
    ]
};
                    
        
                // 为echarts对象加载数据 
                myChart.setOption(option); 
            }
        );
    </script>
</body>